Pooling entropy to facilitate mobile device-based true random number generation

ABSTRACT

A mobile device operating system pools any available entropy. The resulting entropy pool is stored in device memory. When storing entropy in memory, preferably memory addresses are randomly allocated to prevent an attacker from capturing entropy that might have already been used to create a random number. The stored entropy pool provides a readily-available entropy source for any entropy required by the operating system or device applications. Then, when a cryptographic application requests a true random number, the operating system checks to determine whether the pool has available entropy and, if so, a portion of the entropy is provided to enable generation (e.g., by a TRNG) of a true random number that, in turn, may then be used for some cryptographic operation. After providing the entropy, the operating system clears the address locations that were used to provide it so that another entity cannot re-use the entropy.

BACKGROUND OF THE INVENTION

1. Technical Field

This disclosure relates generally to securing data on mobile devicesusing cryptographic techniques and, in particular, to pooling entropy tofacilitate device-based generation of true random numbers that can beused in cryptographic operations.

2. Background of the Related Art

Random numbers are used in many aspects of modern computer systems. Inparticular, random numbers are often used in generating appropriatesecurity parameters in a computer system. Computer systems, however,often have a difficult time generating high quality random numbers,i.e., sequences of numbers that are close to being truly random. Thereare many algorithms that appear to generate random numbers but theytypically generate the same sequence of numbers, thus suffering frompredictability. Some computer systems attempt to add entropy to amechanism that generates random numbers as a way to generate differingsequences of random numbers. Entropy refers to a measure of theuncertainty associated with a random number. There are not many goodsources of entropy on most computer systems. Some computer systems, forexample, rely on the seemingly random behavior of a human typing on akeyboard or moving a mouse pointer to introduce entropy. Other knowntechniques for adding entropy involve the use of time intervals betweeninterrupts, or the occurrence of network errors, although these are notvery useful due to the regularity of these intervals or the ability ofoutside forces to manipulate these intervals. Moreover, computer systemsthat have limited user input have difficulty adding entropy to thesystem to improve the quality of random number generation. For example,embedded systems or highly parallel computer systems may needhigh-quality random numbers, but they may lack the user input as asource of entropy to improve the quality of random number generation.

Mobile devices, including tablets and smart phones, are commonplace andincreasingly being used over networks and the wider Internet. Thesedevices are being used frequently to transfer secure data such aspasswords, personal details, credit card transactions, voice-over-IPcalls, and the like. As a consequence, there is an increasing need tomake such mobile devices more secure. While these devices often havesufficient hardware to perform cryptographic functions (includingencryption and decryption), many cryptographic functions require forsupport a random number generator. Although many of these devices use apseudo random number generator for many cryptographic functions, a truerandom number generator (TRNG) is preferred when available. A TRNG isuseful for generating various cryptographic materials, such as keys,nonces, one-time pads, and salts. Currently, however, mobile devices donot provide hardware-based TRNGs that software can call readily,especially at high throughput.

The sources of high throughput entropy on mobile devices are not alwaysavailable to produce TRNGs. The common entropy sources on mobile devicestypically include the following: batteries, microphones, cameras,wireless signals, touch screens, accelerometers, magnetometers, and thelike. It is well-known to use such sources for entropy and thus truerandom number generation. One problem with this approach is that thesesources are only available for short time periods and/or are not alwayscapable of producing entropy in certain situations. In particular, thedevice operating system often turns off this hardware when not in use(to conserve battery). Turning on microphones, cameras, wirelessinterfaces, and the like, draws significant power that can havesignificant adverse effects on the device's battery life. Without theuse of such devices as entropy sources, TRNGs can be difficult andtime-consuming to generate. Applications having a need to produce TRNGsthus struggle to find a reliable entropy source that is high throughputand readily available without relying on the operating system to switchon and use a hardware device to capture entropy. Moreover, the demandfor high throughput entropy (to create TRNGs) will only be increasing asmobile devices become more essential in environments, especially thosethat require secure communications (such as VoIP, VPN, and the like).These operations require a very high entropy throughput to create theTRNGs required for such computationally-intensive secure communication.Indeed, currently the entropy require for these types of operatingscenarios is simply not available on today's mobile devices.

While the significant and high importance of security even when entropyis made available by hardware, the complexity of an application gainingaccess to the hardware and given entropy can deter the application fromfollowing security and cryptography best practices.

There remains a need to provide mobile devices with an improved way toprovide adequate sources of entropy to enable the system to produce withhigh throughput TRNGs that are needed to support cryptographicoperations.

BRIEF SUMMARY

According to this disclosure, a mobile device mechanism (e.g., anoperating system) pools any available entropy when it is made available.The resulting entropy pool is stored in device memory or associated datastores (e.g., cryptographic memory, RAM, hard drive, flash, or thelike). When storing entropy in memory, preferably memory addresses arerandomly allocated to prevent an attacker from capturing entropy thatmight have already been used to create a random number. The storedentropy pool provides a readily-available entropy source for any entropyrequired by the operating system or device applications. Then, when acryptographic application requests a true random number, the operatingsystem checks to determine whether the pool has available entropy and,if so, a portion of the entropy is provided to enable generation (e.g.,by a TRNG) of a true random number that, in turn, may then be used forsome cryptographic operation. After providing the entropy, the operatingsystem clears (e.g., zeroes) the address locations that were used toprovide it so that another entity cannot re-use the entropy (and thuspotentially compromise some future cryptographic operation). If themobile device operating system becomes low on available entropy,however, it may fall back to direct hardware-based entropy to keep upwith additional requests for true random numbers.

The foregoing has outlined some of the more pertinent features of theinvention. These features should be construed to be merely illustrative.Many other beneficial results can be attained by applying the disclosedinvention in a different manner or by modifying the invention as will bedescribed.

BRIEF DESCRIPTION OF THE DRAWINGS

For a more complete understanding of the present invention and theadvantages thereof, reference is now made to the following descriptionstaken in conjunction with the accompanying drawings, in which:

FIG. 1 depicts an exemplary block diagram of a representative mobiledevice in which the techniques of this disclosure may be implemented;

FIG. 2 is an exemplary block diagram of a data processing system inwhich exemplary aspects of the illustrative embodiments may beimplemented;

FIG. 3 illustrates the mobile device of FIG. 1 in additional detail;

FIG. 4 illustrates a process flow for entropy pooling on the mobiledevice start-up;

FIG. 5 illustrates a process flow for destroying the entropy pool onmobile device shut-down;

FIG. 6 illustrates a process flow for entropy pooling on the mobiledevice upon start-up of particular hardware;

FIG. 7 illustrates a process flow for entropy retrieval from the entropypool; and

FIGS. 8-17 illustrate the allocating, storing, retrieval, zeroing andfreeing of device memory locations to generate and manage the entropypool according to this disclosure.

DETAILED DESCRIPTION OF AN ILLUSTRATIVE EMBODIMENT

With reference now to the drawings and in particular with reference toFIGS. 1-2, exemplary diagrams of data processing environments areprovided in which illustrative embodiments of the disclosure may beimplemented. It should be appreciated that FIGS. 1-2 are only exemplaryand are not intended to assert or imply any limitation with regard tothe environments in which aspects or embodiments of the disclosedsubject matter may be implemented. Many modifications to the depictedenvironments may be made without departing from the spirit and scope ofthe present invention.

FIG. 1 illustrates representative mobile devices, namely, a smartphone100, and a tablet device 102. As is well-known, such devices typicallycomprise fast processors, large amounts of memory, gesture-basedmulti-touch screens, and integrated multi-media and GPS hardware chips.Many of these devices use open mobile operating systems, such asAndroid. The ubiquity, performance and low cost of mobile devices haveopened the door for creation of a large variety of mobile applicationsincluding, without limitation, applications that require or takeadvantage of cryptographic operations. Such operations may be associatedwith a particular application, or the device operating system itself. Aswill be described, the techniques herein may be implemented with respectto any computing entity application that requires a cryptographicoperation that is facilitated with mobile device-resident cryptographicmaterials (e.g., keys, nonces, one-time pads, and salts). Further, thedisclosed entropy pooling technique may be used with any form ofcryptographic scheme (including, without limitation,encryption/decryption, digital signature generation and verification,message validation, and the like) or cryptographic protocol.

With reference now to FIG. 2, a block diagram of an exemplary dataprocessing system is shown in which aspects of the illustrativeembodiments may be implemented. Data processing system 200 is an exampleof a computer, such as mobile device 100 or 102 in FIG. 1, in whichcomputer usable code or instructions implementing the processes forillustrative embodiments of the disclosure may be located.

With reference now to FIG. 2, a block diagram of a data processingsystem is shown in which illustrative embodiments may be implemented.Data processing system 200 is an example of a computer, such as a mobiledevice of FIG. 1, in which computer-usable program code or instructionsimplementing the processes may be located for the illustrativeembodiments. In this illustrative example, data processing system 200includes communications fabric 202, which provides communicationsbetween processor unit 204, memory 206, persistent storage 208,communications unit 210, input/output (I/O) unit 212, and display 214.

Processor unit 204 serves to execute instructions for software that maybe loaded into memory 206. Processor unit 204 may be a set of one ormore processors or may be a multi-processor core, depending on theparticular implementation. Further, processor unit 204 may beimplemented using one or more heterogeneous processor systems in which amain processor is present with secondary processors on a single chip. Asanother illustrative example, processor unit 204 may be a symmetricmulti-processor system containing multiple processors of the same type.

Memory 206 and persistent storage 208 are examples of storage devices. Astorage device is any piece of hardware that is capable of storinginformation either on a temporary basis and/or a permanent basis. Memory206, in these examples, may be, for example, a random access memory orany other suitable volatile or non-volatile storage device. Persistentstorage 208 may take various forms depending on the particularimplementation. For example, persistent storage 208 may contain one ormore components or devices. For example, persistent storage 208 may be ahard drive, a flash memory, a rewritable optical disk, a rewritablemagnetic tape, or some combination of the above. The media used bypersistent storage 208 also may be removable. For example, a removablehard drive may be used for persistent storage 208.

Communications unit 210, in these examples, provides for communicationswith other data processing systems or devices. In these examples,communications unit 210 is a network interface card. Communications unit210 may provide communications through the use of either or bothphysical and wireless communications links.

Input/output unit 212 allows for input and output of data with otherdevices that may be connected to data processing system 200. Forexample, input/output unit 212 may provide a connection for user inputthrough a keyboard and mouse. Further, input/output unit 212 may sendoutput to a printer. Display 214 provides a mechanism to displayinformation to a user.

Instructions for the operating system and applications or programs arelocated on persistent storage 208. These instructions may be loaded intomemory 206 for execution by processor unit 204. The processes of thedifferent embodiments may be performed by processor unit 204 usingcomputer implemented instructions, which may be located in a memory,such as memory 206. These instructions are referred to as program code,computer-usable program code, or computer-readable program code that maybe read and executed by a processor in processor unit 204. The programcode in the different embodiments may be embodied on different physicalor tangible computer-readable media, such as memory 206 or persistentstorage 208.

Program code 216 is located in a functional form on computer-readablemedia 218 that is selectively removable and may be loaded onto ortransferred to data processing system 200 for execution by processorunit 204. Program code 216 and computer-readable media 218 form computerprogram product 220 in these examples. In one example, computer-readablemedia 218 may be in a tangible form, such as, for example, an optical ormagnetic disc that is inserted or placed into a drive or other devicethat is part of persistent storage 208 for transfer onto a storagedevice, such as a hard drive that is part of persistent storage 208. Ina tangible form, computer-readable media 218 also may take the form of apersistent storage, such as a hard drive, a thumb drive, or a flashmemory that is connected to data processing system 200. The tangibleform of computer-readable media 218 is also referred to ascomputer-recordable storage media. In some instances,computer-recordable media 218 may not be removable.

Alternatively, program code 216 may be transferred to data processingsystem 200 from computer-readable media 218 through a communicationslink to communications unit 210 and/or through a connection toinput/output unit 212. The communications link and/or the connection maybe physical or wireless in the illustrative examples. Thecomputer-readable media also may take the form of non-tangible media,such as communications links or wireless transmissions containing theprogram code. The different components illustrated for data processingsystem 200 are not meant to provide architectural limitations to themanner in which different embodiments may be implemented. The differentillustrative embodiments may be implemented in a data processing systemincluding components in addition to or in place of those illustrated fordata processing system 200. Other components shown in FIG. 2 can bevaried from the illustrative examples shown. As one example, a storagedevice in data processing system 200 is any hardware apparatus that maystore data. Memory 206, persistent storage 208, and computer-readablemedia 218 are examples of storage devices in a tangible form.

In another example, a bus system may be used to implement communicationsfabric 202 and may be comprised of one or more buses, such as a systembus or an input/output bus. Of course, the bus system may be implementedusing any suitable type of architecture that provides for a transfer ofdata between different components or devices attached to the bus system.Additionally, a communications unit may include one or more devices usedto transmit and receive data, such as a modem or a network adapter.Further, a memory may be, for example, memory 206 or a cache such asfound in an interface and memory controller hub that may be present incommunications fabric 202.

Computer program code for carrying out operations of the presentinvention may be written in any combination of one or more programminglanguages, including an object-oriented programming language such asJava™, Smalltalk, Objective C, C++ or the like, and conventionalprocedural programming languages, such as the “C” programming languageor similar programming languages. Program code may be written ininterpreted languages, such as Python. The program code may executeentirely on the user's computer, partly on the user's computer, as astand-alone software package, partly on the user's computer and partlyon a remote computer, or entirely on the remote computer or server. Inthe latter scenario, the remote computer may be connected to the user'scomputer through any type of network, including a local area network(LAN) or a wide area network (WAN), or the connection may be made to anexternal computer (for example, through the Internet using an InternetService Provider). The techniques herein may also be implemented innon-traditional IP networks.

Those of ordinary skill in the art will appreciate that the hardware inFIGS. 1-2 may vary depending on the implementation. Other internalhardware or peripheral devices, such as flash memory, equivalentnon-volatile memory, or optical disk drives and the like, may be used inaddition to or in place of the hardware depicted in FIGS. 1-2. Also, theprocesses of the illustrative embodiments may be applied to amultiprocessor data processing system, other than the SMP systemmentioned previously, without departing from the spirit and scope of thedisclosed subject matter.

Without limitation, the techniques described herein may operate inconjunction within mobile devices operating according to a standardclient-server paradigm in which client machines communicate with anInternet-accessible server(s) executing on a set of one or moremachines. In such a scenario, end users operate Internet-connectabledevices (e.g., Internet-enabled mobile devices, or the like) that arecapable of accessing and interacting with the server(s). Typically, eachclient or server machine is a data processing system such as illustratedin FIG. 2 comprising hardware and software, and these entitiescommunicate with one another over a network, such as the Internet, anintranet, an extranet, a private network, or any other communicationsmedium or link. Generalizing, a data processing system typicallyincludes one or more processors, an operating system, one or moreapplications, and one or more utilities. The applications on the dataprocessing system provide native support for Web services including,without limitation, support for HTTP, SOAP, XML, WSDL, UDDI, and WSFL,among others. Information regarding SOAP, WSDL, UDDI and WSFL isavailable from the World Wide Web Consortium (W3C), which is responsiblefor developing and maintaining these standards; further informationregarding HTTP and XML is available from Internet Engineering Task Force(IETF). Familiarity with these standards is presumed.

Mobile Device Technologies

As described above, mobile device technologies also are well-known. In arepresentative but non-limiting embodiment, a mobile device is asmartphone or tablet, such as the iPhone® or iPad®, an Android™-basedmobile device, or the like. As seen in FIG. 3, a device 300 of this typetypically comprises a CPU 302, computer memory 304, such as RAM, and adata store 306. The device software includes operating system (e.g.,Apple iOS, Android, Blackberry OS, Windows Mobile, or the like) 308, andgeneric support applications and utilities 310. Typically, the deviceincludes a separate graphics processing unit (GPU) 312. A touch-sensingdevice or interface 314, such as a touch screen, is configured toreceive input from a user's touch and to send this information toprocessor 312. The interface 314 responds to gestures on the touchsensitive surface. Other input/output devices include software-basedkeyboards, cameras, microphones, accelerometers, magnetometers, radio orWiFi mechanisms, and the like.

More generally, the mobile device is any wireless client device, e.g., acellphone, pager, a personal digital assistant (PDA, e.g., with GPRSNIC, WiFi card, etc.), a mobile computer with a smartphone client, orthe like. Typical wireless protocols are: WiFi, GSM/GPRS, CDMA or WiMax.These protocols implement the ISO/OSI Physical and Data Link layers(Layers 1 & 2) upon which a traditional networking stack is built,complete with IP, TCP, SSL/TLS and HTTP.

For example, a mobile device as used herein is a 3G—(or next generation)compliant device that may include a subscriber identity module (SIM),which is a smart card that carries subscriber-specific information,mobile equipment (e.g., radio and associated signal processing devices),a man-machine interface (MMI), and one or more interfaces to externaldevices. The techniques disclosed herein are not limited for use with amobile device that uses a particular access protocol. The mobile devicetypically also has support for wireless local area network (WLAN)technologies, such as Wi-Fi. WLAN is based on IEEE 802.11 standards.

Generalizing, the mobile device is any wireless client device, e.g., asmartphone, a tablet, a personal digital assistant (PDA, e.g., with GPRSor WiFi-based NIC), a mobile computer with a smartphone or tablet-likeclient, or the like. Other mobile devices in which the technique may bepracticed include any access protocol-enabled device (e.g., aBlackberry® device, an Android™-based device, or the like) that iscapable of sending and receiving data in a wireless manner using awireless protocol. Typical wireless protocols are: WiFi, GSM/GPRS, CDMAor WiMax. These protocols implement the ISO/OSI Physical and Data Linklayers (Layers 1 & 2) upon which a traditional networking stack isbuilt, complete with IP, TCP, SSL/TLS and HTTP.

Entropy Pooling on a Mobile Device

According to this disclosure, a mobile device mechanism (e.g., anoperating system) pools any available entropy when it is made available.The resulting entropy pool is stored in device memory or associated datastores (e.g., cryptographic memory, RAM, hard drive, flash, or thelike). When storing entropy in memory, preferably memory addresses arerandomly allocated to prevent an attacker from capturing entropy thatmight have already been used to create a random number. The storedentropy pool provides a readily-available entropy source for any entropyrequired by the operating system or device applications. Then, when acryptographic application requests a true random number, the operatingsystem checks to determine whether the pool has available entropy and,if so, a portion of the entropy is provided to enable generation (e.g.,by a TRNG) of a true random number that, in turn, may then be used forsome cryptographic operation. After providing the entropy, the operatingsystem clears (e.g., zeroes) the address locations that were used toprovide it so that another entity cannot re-use the entropy (and thuspotentially compromise some future cryptographic operation). If themobile device operating system becomes low on available entropy,however, it may fall back to direct hardware-based entropy to keep upwith additional requests for true random numbers.

FIG. 4 illustrates a process for entropy pooling at mobile devicestart-up. This process flow may take place within the device operatingsystem. The process begins at step 400 when the mobile device isswitched on. At step 402, the mobile device operating system starts anentropy pooling mechanism, which executes as a background task orprocess. At step 404, and in connection with the startup, the devicedrivers load the various hardware devices (e.g., camera, WiFi support,and the like). The entropy pooling mechanism then begins entropychecking. To that end, each hardware device is checked for availableentropy at step 406. A test is then performed at step 408 to determineif the hardware device is producing entropy. If the outcome of the testat step 408 indicates that the hardware device is not producing entropy,the routine continues at step 410 with the operating system continuingits usual operation. If, however, the outcome of the test at step 408indicates that the hardware device is producing entropy, that entropy isthen added to the entropy pool at step 412. Control then continues atstep 410. If additional hardware devices are to be checked, theoperating system returns control back to step 406, and the processrepeats.

FIG. 5 illustrates a process for the device operating system to destroythe entropy pool upon device shut-down. By destroying the entropy pool,the entropy therein cannot be re-used (e.g., to attempt to re-create thepreviously-generated random number(s)). The process begins at step 500when the mobile device operating system starts to shut-down. A test isthen performed at step 502 to determine whether entropy is pooled (inthe entropy pool). If the outcome of the test at step 502 indicates thatthere is no entropy in the pool, control then continues at step 504 andthe mobile device is switched off. If, however, the outcome of the testat step 502 indicates that there is entropy in the pool, the routinecontinues at step 506 to destroy the entropy. Typically, this operationinvolves wiping the memory.

FIG. 6 illustrates a process for entropy pooling on hardware devicestart-up. A particular hardware device may be started at any time andnot necessarily just at device start-up. The steps in FIG. 6 typicallyoccur within the device operating system, although this is not alimitation. In this embodiment, the process begins at step 600 when themobile device operating system receives data from the hardware device.At step 602, the hardware device operates, performing its usualfunction(s). At step 604, the entropy pooling mechanism checks thehardware device for entropy. A test is then performed at step 606 todetermine if the hardware device is producing entropy. If the outcome ofthe test at step 606 indicates that the hardware device is not producingentropy, the routine continues at step 608 to return control back to theoperating system. If, however, the outcome of the test at step 606indicates that the hardware device is producing entropy, that entropy isthen added to the entropy pool at step 610. Control then continues atstep 608.

FIG. 7 illustrates a process for retrieving entropy from the entropypool to facilitate generation of a true random number for somecryptographic operation. In this embodiment, the retrieval operationsare carried out by the device operating system with respect to anentropy pool that has been created according to the techniques shown,e.g., in FIGS. 4 and 6. The routine begins at step 700 with theapplication starting. At step 702, the operating system receives anindication that an application needs entropy from the pool to facilitatea cryptographic operation. The operating system responds at step 704 bychecking the entropy pool. A test is then performed at step 706 todetermine whether there is any available entropy in the pool. If theoutcome of the test at step 706 indicates that there is not available(or insufficient) entropy in the pool, control branches to step 708. Theoperating system then uses an operating system-based random numbergenerator to provide the required random number. This is a fallback (orfailover) operation, as preferably the entropy pool is used. After thetrue random number generator generates the true random number, controlreturns to the application at step 710. If, however, the outcome of thetest at step 706 indicates that there is available entropy in the pool,the routine continues at step 712 with the operating system retrievingthe entropy from the pool. The entropy is then returned to theapplication and control is returned at step 710.

While the various operations are illustrated in the context of a mobiledevice operating system, this is not a limitation. The operations may becarried out in whole or in part by a dedicated entropy poolingapplication, or in combination with various operating system resources.The particular implementation of the entropy pooling creation,management and maintenance may be quite varied depending on availabledevice resources.

Although typically the entropy pool is located on-board the mobiledevice, theoretically it may be stored in some ancillary data store,such as a Flash drive.

FIGS. 8-17 illustrate the allocating, storing, retrieval, zeroing andfreeing of device memory locations to generate and manage the entropypool according to this disclosure. The operating scenarios are merelyexemplary.

FIG. 8 illustrates a first area of device memory with random addresses(hex 0x000CFF00 through 0x000CFF40). At this point, no entropy has beenassociated with any of those addresses.

FIG. 9 illustrates entropy being stored at addresses (hex0x000CFF00-CFF08) in the first area of the memory when a first hardwaredevice (e.g., a microphone) is used. The entropy pool then comprises thedata in these address locations.

FIG. 10 illustrates additional entropy being stored at the nextcontiguous addresses (hex 0x000CFF10-CF28) in the first area of thememory when a second hardware device (e.g., a camera) is used. As aresult, the entropy pool thus has been enlarged to include the data inthese additional locations.

FIG. 11 illustrates the first area of the memory after the operatingsystem has retrieved and zeroed out some of the entropy (namely, fromlocations hex 0x000CFF00-CFF12). The entropy pool then comprises justthe data at the addresses hex 0x000CFF14-CFF28. As illustrated, once theentropy is retrieved from the entropy pool, the addresses are zeroed outfor security (to prevent re-use).

FIG. 12 illustrates further storing of entropy when a third hardwaredevice (e.g., WiFi) is used and entropy is generated. As illustrated,preferably the additional entropy gets stored at what are now thenext-available contiguous locations (addresses hex 0x000CFF30-CFF48) inthe first area and not in the just-cleared locations (corresponding toaddresses 0x000CFF00-CFF12). Preferably, the cleared locations are notre-used to prevent security compromises (e.g., by re-use of thepreviously-used entropy data). As also can be seen, as a result of theadditional entropy data filling up what remained of the first area, theresulting entropy pool is again enlarged but now used up all of theavailable storage locations in the first area of the memory. Becauseadditional memory for the pool is now needed, and because preferably thepreviously-cleared areas are not re-used, the operating system thenestablishes a second area of the memory to receive additional entropy.FIG. 13 illustrates the second area of the memory allocated to maintainthe entropy pool. This allocation of additional area(s) of memory may becarried out dynamically or during an entropy pool configurationoperation. In this example, the second area corresponds to locations atthe following addresses: hex 0x000BA200-0x000BA248. In this example,some of the entropy from the WiFi use then gets placed in the secondarea of the memory. The resulting entropy pool comprises locations hex0x000CFF20-CFF48 in the first area, together with locations 0x000BA202in the second area. The area(s) allocated by the operating system may beof the same or different size. Moreover, and as illustrated, typicallythe areas are not contiguous to one another.

FIG. 14 illustrates storing of additional entropy when a fourth hardwaredevice (e.g., a battery) has available entropy. As a result, theavailable locations in the second area of the memory are now filled tocreate the newly-enlarged entropy pool across both the first and secondmemory areas.

FIG. 15 illustrates storing of still additional entropy data when afifth hardware device (e.g., Bluetooth) has available entropy. Becausethe first and second areas have been filled, the operating systemallocates a third area of memory (e.g., at hex addresses0x000FF200-FF248) whose locations then receive and store the additionalentropy data as illustrated.

FIG. 16 illustrates the memory state after entropy is retrieved onceagain for random number generation and zeroing out of the retrievedentropy. At this point, all of the first area has been freed up, as hasa portion of the second area. The third area still includes availablelocations for storing additional entropy data.

FIG. 17 illustrates the memory after being freed of the entropy. At thispoint, and because it should not be re-used, the first area has beenreturned to the operating system. The entropy pool then remains acrossthe second and third areas as shown.

As the above examples illustrates, as the mobile device itself and/orits various hardware devices start up and generate entropy data, theentropy is added to the entropy pool. The pool itself typically variescontinuously, as has been described and illustrated. As also describedabove, there may be situations when the entropy pool is not sufficientlylarge enough to provide entropy data that may be required for aparticular operation. In such case, the fail-over source of entropy datamay be used.

Preferably, and as illustrated, the operating system randomly allocatesthe memory areas as they are needed to support the continuously-varyingentropy pool. As a result, typically the entropy pool (to the extent itspans more than one area) is not located in contiguous area(s) of thememory but, rather, may comprise entropy data from multiple distinctmemory locations. Once a memory area has been used for storing entropybut has then been cleared, that particular area preferably is no longerre-used to store entropy. Also, preferably entropy is retrieved from theentropy pool in a first-in, first out (FIFO) manner, with the oldestentropy data being retrieved when entropy is needed. Other entropy datastorage and retrieval schemes (e.g., LIFO, or the like) may be used aswell.

Thus, according to this disclosure, a method of generating a true randomnumber for use in a cryptographic operation by receiving entropy dataassociated with device start-up and one or more hardware devices of amobile device. The entropy data is pooled in randomly-allocated memory.In response to a demand for entropy, the entropy pool is examined foravailable entropy. That entropy is then provided (in whole or part) fromthe pool. Using the entropy provided from the pool, an applicationproduces a true random number. The true random number is then used togenerate the cryptographic material. To prevent re-use, the addresslocations from which the entropy is provided are then cleared (zeroed)or other freed.

The subject matter described herein has many advantages. The techniqueprovides a method of pooling and managing entropy from true randomnumber generators (e.g., the device itself, the one or more hardwaresources, or the like). By accessing the entropy pool, the operatingsystem and device-based applications have a ready-available source ofentropy of use in true random number generation. The resulting truerandom numbers can then be used for various cryptographic operationsthat may be required by the device.

The functionality described above may be implemented as a standaloneapproach, e.g., a software-based function executed by a processor, or itmay be available as a managed service (including as a web service via aSOAP/XML interface). The particular hardware and software implementationdetails described herein are merely for illustrative purposes are notmeant to limit the scope of the described subject matter.

More generally, computing devices within the context of the disclosedsubject matter are each a data processing system (such as shown in FIG.2) comprising hardware and software, the device may communicate withother devices and systems over a network, such as the Internet, anintranet, an extranet, a private network, or any other communicationsmedium or link.

Still more generally, the subject matter described herein can take theform of an entirely hardware embodiment, an entirely software embodimentor an embodiment containing both hardware and software elements. In apreferred embodiment, the entropy pooling management function isimplemented in software, which includes but is not limited to firmware,resident software, microcode, and the like. Furthermore, as noted above,the entropy pooling functionality can take the form of a computerprogram product accessible from a computer-usable or computer-readablemedium providing program code for use by or in connection with acomputer or any instruction execution system. For the purposes of thisdescription, a computer-usable or computer readable medium can be anyapparatus that can contain or store the program for use by or inconnection with the instruction execution system, apparatus, or device.The medium can be an electronic, magnetic, optical, electromagnetic,infrared, or a semiconductor system (or apparatus or device). Examplesof a computer-readable medium include a semiconductor or solid statememory, magnetic tape, a removable computer diskette, a random accessmemory (RAM), a read-only memory (ROM), a rigid magnetic disk and anoptical disk. Current examples of optical disks include compactdisk-read only memory (CD-ROM), compact disk-read/write (CD-R/W) andDVD. The computer-readable medium is a tangible item.

The computer program product may be a product having programinstructions (or program code) to implement one or more of the describedfunctions. Those instructions or code may be stored in a computerreadable storage medium in a data processing system after beingdownloaded over a network from a remote data processing system. Or,those instructions or code may be stored in a computer readable storagemedium in a server data processing system and adapted to be downloadedover a network to a remote data processing system for use in a computerreadable storage medium within the remote system.

In a representative embodiment, the entropy pooling mechanism and randomnumber generation components are implemented in a special purposecomputer, preferably in operating system or application softwareexecuted by one or more processors. The software is maintained in one ormore data stores or memories associated with the one or more processors,and the software may be implemented as one or more computer programs.Collectively, this special-purpose hardware and software comprises theentropy pooling mechanism and the associated true random numbergeneration mechanism described.

The entropy pooling function may be implemented as an adjunct orextension to an existing cryptographic application, device, system orprocess.

While the above describes a particular order of operations performed bycertain embodiments of the invention, it should be understood that suchorder is exemplary, as alternative embodiments may perform theoperations in a different order, combine certain operations, overlapcertain operations, or the like. References in the specification to agiven embodiment indicate that the embodiment described may include aparticular feature, structure, or characteristic, but every embodimentmay not necessarily include the particular feature, structure, orcharacteristic.

Finally, while given components of the system have been describedseparately, one of ordinary skill will appreciate that some of thefunctions may be combined or shared in given instructions, programsequences, code portions, and the like.

Any application or functionality described herein may be implemented asnative code, by providing hooks into another application, byfacilitating use of the mechanism as a plug-in, by linking to themechanism, and the like.

The techniques disclosed herein are not limited to a mobile devicehaving an operating system of the type described, but this will be atypical implementation. As noted, the above-described function may beused in any system, device, sub-system, site, or the like whereindevices may generate entropy data.

Having described our invention, what we now claim is as follows:
 1. Amethod to generate a true random number for use in a cryptographicoperation, the method operative in a mobile device comprising anoperating system, and one or more hardware devices, comprising: poolinginto a data store entropy data generated from the one or more hardwaredevices to form an entropy data pool; responsive to a request,retrieving entropy data from particular locations in the data store;using the entropy data retrieved to generate a true random number; andclearing the particular locations from which the entropy data wasretrieved.
 2. The method as described in claim 1 further includingallocating random available storage areas of the data store to store theentropy data as it is pooled into the entropy data pool.
 3. The methodas described in claim 2 wherein a second storage area of the data storeis allocated when a first storage area of the data store that includesthe particular locations is no longer capable of receiving additionalentropy data.
 4. The method as described in claim 1 further includingdetermining whether sufficient entropy data is present in the data storein response to the request and, if so, retrieving the entropy data. 5.The method as described in claim 4 further including using a randomnumber generator to generate the true random number if there is notsufficient entropy in the entropy data pool.
 6. The method as describedin claim 1 further including supplementing the entropy data pooldynamically as one or more of the hardware devices generate additionalentropy.
 7. The method as described in claim 1 wherein the particularlocations are cleared by zeroing.
 8. An apparatus associated with amobile device, the mobile device comprising an operating system, and oneor more hardware devices that generate entropy data, the apparatuscomprising: a processor; computer memory comprising a data store, andcomputer program instructions, the computer program instructionscomprising: program code to pool into the data store entropy datagenerated from the one or more hardware devices to form an entropy datapool; program code responsive to a request to retrieve entropy data fromparticular locations in the data store; program code to use the entropydata retrieved to generate a true random number; and program code toclear the particular locations from which the entropy data wasretrieved.
 9. The apparatus as described in claim 8 further includingprogram code to allocate random available storage areas of the datastore to store the entropy data as it is pooled into the entropy datapool.
 10. The apparatus as described in claim 9 wherein a second storagearea of the data store is allocated when a first storage area of thedata store that includes the particular locations is no longer capableof receiving additional entropy data.
 11. The apparatus as described inclaim 8 further including program code to determine whether sufficiententropy data is present in the data store in response to the requestand, if so, retrieving the entropy data.
 12. The apparatus as describedin claim 11 further including a random number generator to generate thetrue random number if there is not sufficient entropy in the entropydata pool.
 13. The apparatus as described in claim 8 further includingprogram code to supplement the entropy data pool dynamically as one ormore of the hardware devices generate additional entropy.
 14. Theapparatus as described in claim 8 wherein the particular locations arecleared by zeroing.
 15. A computer program product in a non-transitorycomputer readable medium for use in a mobile device, the mobile devicecomprising an operating system, and one or more hardware devices thatgenerate entropy data, the computer program product holding computerprogram instructions comprising: program code to pool into a data storeentropy data generated from the one or more hardware devices to form anentropy data pool; program code responsive to a request to retrieveentropy data from particular locations in the data store; program codeto use the entropy data retrieved to generate a true random number; andprogram code to clear the particular locations from which the entropydata was retrieved.
 16. The computer program product as described inclaim 15 further including program code to allocate random availablestorage areas of the data store to store the entropy data as it ispooled into the entropy data pool.
 17. The computer program product asdescribed in claim 16 wherein a second storage area of the data store isallocated when a first storage area of the data store that includes theparticular locations is no longer capable of receiving additionalentropy data.
 18. The computer program product as described in claim 15further including program code to determine whether sufficient entropydata is present in the data store in response to the request and, if so,retrieving the entropy data.
 19. The computer program product asdescribed in claim 18 further including a random number generator togenerate the true random number if there is not sufficient entropy inthe entropy data pool.
 20. The computer program product as described inclaim 15 further including program code to supplement the entropy datapool dynamically as one or more of the hardware devices generateadditional entropy.